float4x4 WorldVP : WORLDVP;

texture MatTexture : TEXTURE2DA;
sampler2D textureSamp = sampler_state
{
	Texture = <MatTexture>;
	MipFilter = POINT;
    MinFilter = POINT;
    MagFilter = POINT;
	AddressU  = Clamp;
	AddressV  = Clamp;
};

struct VOUT
{
	float4 pos : POSITION0;
    float2 tex : TEXCOORD0;
};

VOUT ambientVS(
	float4 pos : POSITION0,
    float2 tex : TEXCOORD0)
{
	VOUT vout = (VOUT)0;

	vout.pos = mul(pos,WorldVP);
	vout.tex = tex;

	return vout;
}

VOUT ambientQuadVS(
	float4 pos : POSITION0,
    float2 tex : TEXCOORD0)
{
	VOUT vout = (VOUT)0;

	vout.pos = pos;
	vout.tex = tex;

	return vout;
}

float4 ambientPS(VOUT pin) : COLOR0
{
	float4 color = tex2D(textureSamp,pin.tex);
	return color;
};

technique AmbientTech
{
	pass Pass0
	{
		CullMode         = CCW;
		AlphaBlendEnable = TRUE;
		SrcBlend         = SRCALPHA;
		DestBlend        = INVSRCALPHA;

		VertexShader = compile vs_3_0 ambientVS();
		PixelShader  = compile ps_3_0 ambientPS();
	}	
}

technique AmbientQuadTech
{
	pass Pass0
	{
		CullMode         = CCW;
		AlphaBlendEnable = TRUE;
		SrcBlend         = SRCALPHA;
		DestBlend        = INVSRCALPHA;

		VertexShader = compile vs_3_0 ambientQuadVS();
		PixelShader  = compile ps_3_0 ambientPS();
	}	
}